<template>
    <div>
        <p>{{name}}</p>
        <ul>
            <li v-for="p in person" :key="p.id">
                {{p.username}}
            </li>
        </ul>
    </div>
</template>

<script setup>
import {ref,reactive, onMounted} from 'vue'
import axios from 'axios'

let name = ref('我')
let person = reactive([])
// console.log('axios get: ', axios.get('http://localhost:8086/selectAll'))//Proimse对象

console.log('外', person)

onMounted(()=>{
    axios.get('http://localhost:8086/selectAll').then((response)=>{
        console.log(response);
        console.log(person)
        person = response.data
        console.log('后', person)
    })
})

</script>

<style>

</style>